﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace StringFormatTesting
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            label1.Text = string.Empty;
        }

        private void button1_Click(object sender, EventArgs e)
        {
            string Input = textBox1.Text;
            string FormatString = textBox2.Text;

            try
            {
                label1.Text = String.Format(FormatString, Input);
            }
            catch
            {
                label1.Text = "** ERROR **";
            }
        }
    }
}
